package com.es.www.simpleFactory;

/**
 * @Created by michangtao
 * @Date 2022/4/28 15:39
 * @Description
 */
public class Singleton2 {

    private Singleton2(){

    }

    private static Singleton2 instance = null;

    public static Singleton2 getInstance(){
        if (instance == null){
            synchronized (Singleton2.class){
                if (instance == null) {
                    instance = new Singleton2();
                }
            }
        }
        return instance;
    }

}
